package com.rabbiter.association.service;

import com.rabbiter.association.msg.R;

import javax.servlet.http.HttpServletResponse;
import java.util.Map;


public interface AliPayService {
    /**
     * 预下单
     *
     * @param orderId
     * @return
     */
    String aliPayPreorder(String orderId);

    /**
     * 获取支付二维码
     *
     * @param orderId 订单ID
     * @return
     */
    R getQrCode(String orderId);

    /**
     * 支付二维码图片
     *
     * @param orderId  订单ID
     * @param response 响应
     */
    void getQrCodeImage(String orderId, HttpServletResponse response);

    /**
     * 支付回调
     *
     * @param params 回调参数
     * @return
     */
    R aliPayNotify(Map<String, String> params);

    /**
     * 查询订单
     *
     * @param orderId 订单ID
     * @return
     */
    R queryAliPayOrder(String orderId);

    /**
     * 退款
     *
     * @param params 退款参数
     * @return
     */
    R aliPayRefund(Map<String, String> params);

    /**
     * 退款查询
     *
     * @param orderId 订单ID
     * @return
     */
    R aliPayRefundQuery(String orderId);

    /**
     * 账单下载
     *
     * @param billDate 账单日期
     * @param type     账单类型
     */
    R getAliPayBill(String billDate, String type);

    /**
     * 订单撤销
     *
     * @param orderId 订单ID
     * @return
     */
    R cancelAliPayOrder(String orderId);
}
